//
//  ShareHelp.swift
//  weile
//
//  Created by LKM on 16/11/3.
//  Copyright © 2016年 LKM. All rights reserved.
//

import UIKit

class ShareHelp {

    
    class func share( vc:UIViewController ,text:String,image:String,url:String,finsh: ((_ isSuccess:Bool)->())? ){
        
        let t=text+url;
        //let image = #imageLiteral(resourceName: "ic_logo");
        
        //let url=URL(string: "http://baidu.com")
        // 服务类型控制器[t,image,url]
        let activityViewController = UIActivityViewController(activityItems: [t], applicationActivities: nil)
        
        vc.present(activityViewController, animated: true, completion: nil)
        
        activityViewController.completionWithItemsHandler = { activity, success, items, error  in
            LKMLog("===\(activity)")
            finsh?(success)
            if(success){
                LKMLog("ok")
            }
        }
        
    }

}
